home *** CD-ROM | disk | FTP | other *** search
- /* Save_Address */
- /* A SuperMacro by Steven. R. Giovenella, 5823 Dutchess Dr., Colorado Springs, CO
- 80918. © Copyright 1994 Steven. R. Giovenella, All rights reserved.
- This macro is my gift to the Amiga community. It may be given away freely to
- anyone, but it may NOT be sold in any way, shape, or form, not even for the cost of
- reproduction, shipping, or handling, without express written permission from the
- author. This macro may NOT be added to any disk which is to be sold for any price
- or fee, to include shipping and handling. The ONLY way this macro may be
- distributed is on a disk which is given away 100% free of all charges, or via
- telecommunications networks which do not charge any additional fee as a result of a
- user downloading this particular macro, although general fees for access to the
- telecommunications system as a whole are acceptable. This macro may only
- bereproduced in its entirety, including all comment lines and code. The individual
- user may alter this macro for personal use, but may not then distribute the macro
- in any modified form. If you wish, feel free to send me some money, a Christmas
- card, some other piece of software, or absolutely nothing as a gift for creating this
- macro. The author of this software is not responsible for any data loss or damage to
- computer equipment as a result, direct or indirect, of the use of this macro. */
-
- Options Results
-
- /* Initialize*/
- type " "
- backspace
-
- /* Open DataFile */
- RequestText '"Save Address" "Enter destination Data File..."
- "Address_DataFile"'
- datafile=Result
- file = "FWDocs/"||datafile
- Open file
- altdown
- ctrldown
- cursor down
-
- /* Switch ARexx Addresses */
- Status PortName
- port=Result
- portnumber=RIGHT(port,1)+1
- newport=LEFT(port,7)||portnumber
- ADDRESS VALUE newport
-
- /* Goto to end of file */
- AltDOWN
- CtrlDOWN
- Cursor DOWN
- AltUP
- CtrlUP
-
- /* Get ending linenumber */
- Status LinePos
- Coords = Result
- PARSE VAR Coords Line Pos
-
- EnterAddress:
- /* Input record */
- RequestText '"SAVE Address" "First name <Middle>. (Line 1 of 9)" ""'
- Address.1 = Result
- RequestText '"SAVE Address" "Last name. (Line 2 of 9)" ""'
- Address.2 = Result
- RequestText '"SAVE Address" "Company name. (Line 3 of 9)" ""'
- Address.3 = Result
- RequestText '"SAVE Address" "Street address, line one. (Line 4 of 9)" ""'
- Address.4 = Result
- RequestText '"SAVE Address" "Street address, line two. (Line 5 of 9)" ""'
- Address.5 = Result
- RequestText '"SAVE Address" "City name. (Line 6 of 9)" ""'
- Address.6 = Result
- RequestText '"SAVE Address" "State. (Line 7 of 9)" ""'
- Address.7 = Result
- RequestText '"SAVE Address" "Zip Code. (Line 8 of 9)" ""'
- Address.8 = Result
- RequestText '"SAVE Address" "Phone Number. (Line 9 of 9)" ""'
- Address.9 = Result
-
- /* Format record (remove commas) */
- DO j=1 to 8
- DO i=1 to LENGTH(address.j)
- IF RIGHT(LEFT(address.j , i) , 1) = "," THEN DO
- fronthalf = LEFT(address.j , (i-1))
- backhalf = RIGHT(address.j , LENGTH(address.j) - i)
- address.j = fronthalf || " " || backhalf
- END
- END
- END
-
- /* Confirmation */
- ShowMessage 1 0 '"Confirm that you wish to save this address." "" "" "Save" "
- Re-Input Address " " Cancel "'
- IF Result=2 THEN Call EnterAddress
- IF Result=3 THEN DO
- Close Force
- Exit
- END
-
- /* Insert Record */
- type address.2
- type ","
- type address.1
- type ","
- DO i=3 to 9
- type address.i
- type ","
- END
- backspace
- newparagraph
-
- /* Select from line 2 position 0 to end-1 */
- MoveToPara 2 0
- ShiftDOWN
- CtrlDOWN
- AltDOWN
- Cursor DOWN
- AltUP
- CtrlUP
- Cursor UP
-
- /* Sort */
- Sort LowToHigh
-
- /* Deselect */
- Cursor DOWN
- AltUP
- CtrlUP
- ShiftUP
- MoveToLine 2 0
-
- /* Set ASCII Prefs */
- ASCIIPrefs InsertNewLine YES InsertBlankLine YES
-
- /* Save ASCII */
- Save
- Save ASCII "FWDocs/"datafile||".MergeFile"
-
- /* Close DataFile */
- Close FORCE
-